<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <!-- 引入Vue 全局注册一个名为Vue的构造函数 -->
          <script src="../js/vue.js"></script>
    <title>Prop的使用</title>
</head>
<body>
    
    <div id="root">
       测试组件属性

       <blog-post
  v-for="post in posts"
  v-bind:key="post.id"
  v-bind:title="post.title"></blog-post>

  <input type="text" v-model="num">
    </div>


    <script>


Vue.component('blog-post', {
  props: ['title'],
  template: '<h3>{{ title }}</h3>'
})

        new Vue({
        el: '#root',
        data: {
            num:10,
         posts: [
      { id: 1, title: 'My journey with Vue' },
      { id: 2, title: 'Blogging with Vue' },
      { id: 3, title: 'Why Vue is so fun' }
    ]
        },
        methods:{
        
        }
        })
    </script>
</body>
</html>